package com.sky.context;


/**
 * 定义ThreaLocal线程
 * void set(T value) 设置当前现场的局部变量值
 * T get() 返回线程所定义的局部变量值
 * void remove() 移除当前线程的变量
 */
public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
